<?php include_once($_SERVER['DOCUMENT_ROOT']."/controller/common/common_setting_unit.php"); ?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<? include_once("../modules/head.php"); ?>
<link rel="stylesheet" href="app.css" />

<? 

$detail    = select_one_line_all_items($table_Prefix."theme_set", ""); 

if($detail['theme_data']){
	$detail['theme_data'] = unserialize($detail['theme_data']);
}

$plate = select_lines_all_items($table_Prefix."plate");
$banner_term = select_lines_all_items($table_Prefix."banner_term");

?>
</head>

<body>

<div id="topbar">
    <!--TopBar端點01-->
    <?php include '../modules/topbar.php'; ?>
    <!--TopBar端點02-->
</div>

<div id="container">
    <!--Container端點01-->
    <div id="maincontent">
        <!--maincontent端點01-->

        <div id="sidebar">
            <?php include '../modules/sidebar.php'; ?>
        </div>


        <div id="content">
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                <legend><h1>网站首页设置</h1></legend>
            </fieldset>

            <blockquote class="layui-elem-quote">基础设置多数是对外使用的资料，请细心填写。</blockquote>
            <br/>


			<div class="site detail-box ">
				<div class="detail-boxes">
					<ul class="detail-boxing">
                        

                            <fieldset class="layui-elem-field layui-field-title" >
                                <legend>基础设置</legend>
                            </fieldset>
							
                            
                            <div class="container" >
                                <div id="advanced" >

                                    <div style="width: 50%;max-width: 50%; float: left; margin-top: 15px; margin-left: 10px" class="block__list block__list_words">
                                        <div class="block__list-title">显示模块</div>
                                        <form id="site_info" method="post" action="save.php" enctype="multipart/form-data" name="uploadfile">
                                        <ul id="advanced-1" style="height:520px; overflow:scroll">
                                       		<?php 
											if($detail['theme_data']){
												foreach($detail['theme_data'] as $key=>$val){
												
												$now_theme = explode("_",$key);
												$key_0 = $now_theme[0];
												$key_1 = $now_theme[1];
											?>
                                            <?php
													if($key=='search'){
													?>
                                            			<li>搜索框<input type="hidden" name="theme[search]" /><i class="js-remove">✖</i></li>
											<?php
													}
													elseif($key=='foot_nav'){
													?>
                                            			<li>底栏<input type="hidden" name="theme[search]" /><i class="js-remove">✖</i></li>
											<?php
													}
													elseif($key_0=='plate'){
													foreach($plate as $pkey=>$pval){
														if($pval['mid'] == $key_1){
											?>
                                            		<li>板块"<?php echo $pval['name']?>"内容
                                                        <input type="hidden" name="theme[plate_<?php echo $pval['mid']?>]" />  <i class="js-remove">✖</i> 
                                                    </li>
                                            <?php 
														}
													}
													}
													elseif($key_0=='banner'){
													foreach($banner_term as $bkey=>$bval){
														if($bval['mid'] == $key_1){
											?>
                                            		<li>横幅"<?php echo $bval['name']?>"内容
                                                        <input type="hidden" name="theme[banner_<?php echo $bval['mid']?>]" /> <i class="js-remove">✖</i>  
                                                    </li>
                                            <?php
														}
													}
													}
												}
											}
											?>
                                        </ul>
                                        <div class="function">
                                <input type="submit" class="layui-btn" value="确认"/>
                                <input type="reset" class="layui-btn" value="重置"/>
                            </div>
                                        </form>
                                    </div>
                        
                                    <div style="width:48%;max-width: 50%;  float: left; margin-top: 15px; margin-left: 10px" class="block__list block__list_words">
                                        <div class="block__list-title">模块选择</div>
                                        <ul id="advanced-2" style="height:520px; overflow:scroll">
                                            <li>搜索框<input type="hidden" name="theme[search]" /><i class="js-remove">✖</i></li>
                                            <li>底栏<input type="hidden" name="theme[foot_nav]" /><i class="js-remove">✖</i></li>
                                           
                                            <?php 
											foreach($plate as $key=>$val){
											?>
                                            <li>板块"<?php echo $val['name']?>"内容
                                            	<input type="hidden" name="theme[plate_<?php echo $val['mid']?>]" /><i class="js-remove">✖</i>
                                            	
                                            </li>
                                            <?php }?>
                                            <?php 
											foreach($banner_term as $key=>$val){
											?>
                                            <li>横幅"<?php echo $val['name']?>"内容
                                            	<input type="hidden" name="theme[banner_<?php echo $val['mid']?>]" /><i class="js-remove">✖</i>
                                            	
                                            </li>
                                            
                                            <?php }?>
                                           
                                        </ul>
                                    </div>
                        
                                    
                        
                                    <div style="clear: both"></div>
                                </div>
                            </div>
    
                            <hr/>
                        
                            
                       
                    </ul>
                </div>
            </div>

            <!--content端點01-->
        </div>
        <!--maincontent端點01-->
        <br class="clearfloat"/>
    </div>
    <!--container端點01-->
</div>

<script type="text/javascript" src="Sortable.js"></script>
<script type="text/javascript" src="app.js"></script>
<script src="http://cdn.bootcss.com/angular.js/1.2.32/angular.min.js"></script>
<?php include  ROOT_PATH_."/controller/modules/footer.php"; ?>

</body>
</html>
